<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Freetype OpenGL: Vector</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="style.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="content"><!-- do not remove this div! -->

<div id="top"><!-- do not remove this div! -->

  
  <div id="titlearea">
    
    <div id="projectname">Freetype OpenGL</div>
    
    
    <div id="projectbrief">A high quality OpenGL text rendering engine for C</div>
    
  </div>
  

<!--

<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Freetype OpenGL
   &#160;<span id="projectnumber">0.1</span>
   </div>
   <div id="projectbrief">A high quality OpenGL text rendering engine for C</div>
  </td>
  
  
  
   
  
 </tr>
 </tbody>
</table>
</div>
-->


<!-- Generated by Doxygen 1.8.0 -->
<script type="text/javascript" src="dynsections.js"></script>
</div>
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Vector</div>  </div>
</div><!--header-->
<div class="contents">
<hr/><a name="details" id="details"></a><h2>Synopsis</h2>
<p>The vector structure and accompanying functions loosely mimic the STL C++ vector class. </p>
<p>It is used by <a class="el" href="group__texture-atlas.html">Texture atlas</a> (for storing nodes), <a class="el" href="group__texture-font.html">Texture font</a> (for storing glyphs) and <a class="el" href="group__font-manager.html">Font manager</a> (for storing fonts). More information at <a href="http://www.cppreference.com/wiki/container/vector/start">http://www.cppreference.com/wiki/container/vector/start</a></p>
<p><b>Example Usage</b>: </p>
<div class="fragment"><pre class="fragment"><span class="preprocessor"> #include &quot;<a class="code" href="vector_8h.html">vector.h</a>&quot;</span>

 <span class="keywordtype">int</span> main( <span class="keywordtype">int</span> arrgc, <span class="keywordtype">char</span> *argv[] )
 {
   <span class="keywordtype">int</span> i,j = 1;
   <a class="code" href="structvector__t.html" title="Generic vector structure.">vector_t</a> * vector = <a class="code" href="group__vector.html#ga9ab13f896bb29debbbf8175e75751ea5" title="Creates a new empty vector.">vector_new</a>( <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>) );
   <a class="code" href="group__vector.html#ga0934c3049233d3688b7fa74e23536bbf" title="Appends given item to the end of the vector.">vector_push_back</a>( &amp;i );
 
   j = * (<span class="keywordtype">int</span> *) <a class="code" href="group__vector.html#ga6ed3fefa82526009ff0763191dcd9a93" title="Returns a pointer to the item located at specified index.">vector_get</a>( vector, 0 );
   <a class="code" href="group__vector.html#gae045e222efa8898716f8322c5667f624" title="Deletes a vector.">vector_delete</a>( vector);

   <span class="keywordflow">return</span> 0;
 }
</pre></div> <table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structvector__t.html">vector_t</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generic vector structure.  <a href="structvector__t.html#details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga9ab13f896bb29debbbf8175e75751ea5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structvector__t.html">vector_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__vector.html#ga9ab13f896bb29debbbf8175e75751ea5">vector_new</a> (size_t item_size)</td></tr>
<tr class="memdesc:ga9ab13f896bb29debbbf8175e75751ea5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new empty vector.  <a href="#ga9ab13f896bb29debbbf8175e75751ea5"></a><br/></td></tr>
<tr class="memitem:gae045e222efa8898716f8322c5667f624"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__vector.html#gae045e222efa8898716f8322c5667f624">vector_delete</a> (<a class="el" href="structvector__t.html">vector_t</a> *self)</td></tr>
<tr class="memdesc:gae045e222efa8898716f8322c5667f624"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deletes a vector.  <a href="#gae045e222efa8898716f8322c5667f624"></a><br/></td></tr>
<tr class="memitem:ga6ed3fefa82526009ff0763191dcd9a93"><td class="memItemLeft" align="right" valign="top">const void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__vector.html#ga6ed3fefa82526009ff0763191dcd9a93">vector_get</a> (const <a class="el" href="structvector__t.html">vector_t</a> *self, size_t index)</td></tr>
<tr class="memdesc:ga6ed3fefa82526009ff0763191dcd9a93"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a pointer to the item located at specified index.  <a href="#ga6ed3fefa82526009ff0763191dcd9a93"></a><br/></td></tr>
<tr class="memitem:ga89ea189955bd6c4873aca8288c96ad1b"><td class="memItemLeft" align="right" valign="top">const void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__vector.html#ga89ea189955bd6c4873aca8288c96ad1b">vector_front</a> (const <a class="el" href="structvector__t.html">vector_t</a> *self)</td></tr>
<tr class="memdesc:ga89ea189955bd6c4873aca8288c96ad1b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a pointer to the first item.  <a href="#ga89ea189955bd6c4873aca8288c96ad1b"></a><br/></td></tr>
<tr class="memitem:ga1b74708d66280dbf5865bb51e8f5c394"><td class="memItemLeft" align="right" valign="top">const void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__vector.html#ga1b74708d66280dbf5865bb51e8f5c394">vector_back</a> (const <a class="el" href="structvector__t.html">vector_t</a> *self)</td></tr>
<tr class="memdesc:ga1b74708d66280dbf5865bb51e8f5c394"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a pointer to the last item.  <a href="#ga1b74708d66280dbf5865bb51e8f5c394"></a><br/></td></tr>
<tr class="memitem:ga3449b56bc57599ceca39ee5960057ac4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__vector.html#ga3449b56bc57599ceca39ee5960057ac4">vector_contains</a> (const <a class="el" href="structvector__t.html">vector_t</a> *self, const void *item, int(*cmp)(const void *, const void *))</td></tr>
<tr class="memdesc:ga3449b56bc57599ceca39ee5960057ac4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if an item is contained within the vector.  <a href="#ga3449b56bc57599ceca39ee5960057ac4"></a><br/></td></tr>
<tr class="memitem:ga0d33ab9aaff247d38876b1fe76c4e2ef"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__vector.html#ga0d33ab9aaff247d38876b1fe76c4e2ef">vector_empty</a> (const <a class="el" href="structvector__t.html">vector_t</a> *self)</td></tr>
<tr class="memdesc:ga0d33ab9aaff247d38876b1fe76c4e2ef"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks whether the vector is empty.  <a href="#ga0d33ab9aaff247d38876b1fe76c4e2ef"></a><br/></td></tr>
<tr class="memitem:ga0103842074bb797fc685b33c0629c05a"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__vector.html#ga0103842074bb797fc685b33c0629c05a">vector_size</a> (const <a class="el" href="structvector__t.html">vector_t</a> *self)</td></tr>
<tr class="memdesc:ga0103842074bb797fc685b33c0629c05a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of items.  <a href="#ga0103842074bb797fc685b33c0629c05a"></a><br/></td></tr>
<tr class="memitem:ga1a1e63e13a4da5587aa0b9369580eb85"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__vector.html#ga1a1e63e13a4da5587aa0b9369580eb85">vector_reserve</a> (<a class="el" href="structvector__t.html">vector_t</a> *self, const size_t size)</td></tr>
<tr class="memdesc:ga1a1e63e13a4da5587aa0b9369580eb85"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reserve storage such that it can hold at last size items.  <a href="#ga1a1e63e13a4da5587aa0b9369580eb85"></a><br/></td></tr>
<tr class="memitem:ga94c636cfdfd80206e765331d8b44651e"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__vector.html#ga94c636cfdfd80206e765331d8b44651e">vector_capacity</a> (const <a class="el" href="structvector__t.html">vector_t</a> *self)</td></tr>
<tr class="memdesc:ga94c636cfdfd80206e765331d8b44651e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns current storage capacity.  <a href="#ga94c636cfdfd80206e765331d8b44651e"></a><br/></td></tr>
<tr class="memitem:ga0b9c4f4cf48f0c52daa7852aeb7e531c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__vector.html#ga0b9c4f4cf48f0c52daa7852aeb7e531c">vector_shrink</a> (<a class="el" href="structvector__t.html">vector_t</a> *self)</td></tr>
<tr class="memdesc:ga0b9c4f4cf48f0c52daa7852aeb7e531c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decrease capacity to fit actual size.  <a href="#ga0b9c4f4cf48f0c52daa7852aeb7e531c"></a><br/></td></tr>
<tr class="memitem:gaa24245f42c8bb6f84933133f6a560deb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__vector.html#gaa24245f42c8bb6f84933133f6a560deb">vector_clear</a> (<a class="el" href="structvector__t.html">vector_t</a> *self)</td></tr>
<tr class="memdesc:gaa24245f42c8bb6f84933133f6a560deb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes all items.  <a href="#gaa24245f42c8bb6f84933133f6a560deb"></a><br/></td></tr>
<tr class="memitem:ga50c566682c6ec48ef8f7f4224c112d03"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__vector.html#ga50c566682c6ec48ef8f7f4224c112d03">vector_set</a> (<a class="el" href="structvector__t.html">vector_t</a> *self, const size_t index, const void *item)</td></tr>
<tr class="memdesc:ga50c566682c6ec48ef8f7f4224c112d03"><td class="mdescLeft">&#160;</td><td class="mdescRight">Replace an item.  <a href="#ga50c566682c6ec48ef8f7f4224c112d03"></a><br/></td></tr>
<tr class="memitem:ga99460cea333533ca48e5cb23c37642f0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__vector.html#ga99460cea333533ca48e5cb23c37642f0">vector_erase</a> (<a class="el" href="structvector__t.html">vector_t</a> *self, const size_t index)</td></tr>
<tr class="memdesc:ga99460cea333533ca48e5cb23c37642f0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Erase an item.  <a href="#ga99460cea333533ca48e5cb23c37642f0"></a><br/></td></tr>
<tr class="memitem:ga089b70be0dbd06c497470359e725b4ef"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__vector.html#ga089b70be0dbd06c497470359e725b4ef">vector_erase_range</a> (<a class="el" href="structvector__t.html">vector_t</a> *self, const size_t first, const size_t last)</td></tr>
<tr class="memdesc:ga089b70be0dbd06c497470359e725b4ef"><td class="mdescLeft">&#160;</td><td class="mdescRight">Erase a range of items.  <a href="#ga089b70be0dbd06c497470359e725b4ef"></a><br/></td></tr>
<tr class="memitem:ga0934c3049233d3688b7fa74e23536bbf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__vector.html#ga0934c3049233d3688b7fa74e23536bbf">vector_push_back</a> (<a class="el" href="structvector__t.html">vector_t</a> *self, const void *item)</td></tr>
<tr class="memdesc:ga0934c3049233d3688b7fa74e23536bbf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Appends given item to the end of the vector.  <a href="#ga0934c3049233d3688b7fa74e23536bbf"></a><br/></td></tr>
<tr class="memitem:ga03f7948a7302fda208afe31bf7f324eb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__vector.html#ga03f7948a7302fda208afe31bf7f324eb">vector_pop_back</a> (<a class="el" href="structvector__t.html">vector_t</a> *self)</td></tr>
<tr class="memdesc:ga03f7948a7302fda208afe31bf7f324eb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes the last item of the vector.  <a href="#ga03f7948a7302fda208afe31bf7f324eb"></a><br/></td></tr>
<tr class="memitem:gae88ff6d21d8f963ba97790086d18506a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__vector.html#gae88ff6d21d8f963ba97790086d18506a">vector_resize</a> (<a class="el" href="structvector__t.html">vector_t</a> *self, const size_t size)</td></tr>
<tr class="memdesc:gae88ff6d21d8f963ba97790086d18506a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Resizes the vector to contain size items.  <a href="#gae88ff6d21d8f963ba97790086d18506a"></a><br/></td></tr>
<tr class="memitem:gaa69087a65fe41ccc9a6763053a0db7da"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__vector.html#gaa69087a65fe41ccc9a6763053a0db7da">vector_insert</a> (<a class="el" href="structvector__t.html">vector_t</a> *self, const size_t index, const void *item)</td></tr>
<tr class="memdesc:gaa69087a65fe41ccc9a6763053a0db7da"><td class="mdescLeft">&#160;</td><td class="mdescRight">Insert a single item at specified index.  <a href="#gaa69087a65fe41ccc9a6763053a0db7da"></a><br/></td></tr>
<tr class="memitem:gaea8a2ae4d0d06d93f38b24697a5ac5ec"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__vector.html#gaea8a2ae4d0d06d93f38b24697a5ac5ec">vector_insert_data</a> (<a class="el" href="structvector__t.html">vector_t</a> *self, const size_t index, const void *data, const size_t count)</td></tr>
<tr class="memdesc:gaea8a2ae4d0d06d93f38b24697a5ac5ec"><td class="mdescLeft">&#160;</td><td class="mdescRight">Insert raw data at specified index.  <a href="#gaea8a2ae4d0d06d93f38b24697a5ac5ec"></a><br/></td></tr>
<tr class="memitem:gaabe89daaacdda4c42daf166e2f52f159"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__vector.html#gaabe89daaacdda4c42daf166e2f52f159">vector_push_back_data</a> (<a class="el" href="structvector__t.html">vector_t</a> *self, const void *data, const size_t count)</td></tr>
<tr class="memdesc:gaabe89daaacdda4c42daf166e2f52f159"><td class="mdescLeft">&#160;</td><td class="mdescRight">Append raw data to the end of the vector.  <a href="#gaabe89daaacdda4c42daf166e2f52f159"></a><br/></td></tr>
<tr class="memitem:gaee95bbc2e143793c2ffdf3f107aac1bd"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__vector.html#gaee95bbc2e143793c2ffdf3f107aac1bd">vector_sort</a> (<a class="el" href="structvector__t.html">vector_t</a> *self, int(*cmp)(const void *, const void *))</td></tr>
<tr class="memdesc:gaee95bbc2e143793c2ffdf3f107aac1bd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sort vector items according to cmp function.  <a href="#gaee95bbc2e143793c2ffdf3f107aac1bd"></a><br/></td></tr>
</table>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga1b74708d66280dbf5865bb51e8f5c394"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const void* <a class="el" href="group__vector.html#ga1b74708d66280dbf5865bb51e8f5c394">vector_back</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structvector__t.html">vector_t</a> *&#160;</td>
          <td class="paramname"><em>self</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns a pointer to the last item. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a vector structure </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>pointer on the last item </dd></dl>

</div>
</div>
<a class="anchor" id="ga94c636cfdfd80206e765331d8b44651e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t <a class="el" href="group__vector.html#ga94c636cfdfd80206e765331d8b44651e">vector_capacity</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structvector__t.html">vector_t</a> *&#160;</td>
          <td class="paramname"><em>self</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns current storage capacity. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a vector structure </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>storage capacity </dd></dl>

</div>
</div>
<a class="anchor" id="gaa24245f42c8bb6f84933133f6a560deb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group__vector.html#gaa24245f42c8bb6f84933133f6a560deb">vector_clear</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structvector__t.html">vector_t</a> *&#160;</td>
          <td class="paramname"><em>self</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Removes all items. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a vector structure </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga3449b56bc57599ceca39ee5960057ac4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="group__vector.html#ga3449b56bc57599ceca39ee5960057ac4">vector_contains</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structvector__t.html">vector_t</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>item</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int(*)(const void *, const void *)&#160;</td>
          <td class="paramname"><em>cmp</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Check if an item is contained within the vector. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a vector structure </td></tr>
    <tr><td class="paramname">item</td><td>item to be searched in the vector </td></tr>
    <tr><td class="paramname">cmp</td><td>a pointer a comparison function </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>1 if item is contained within the vector, 0 otherwise </dd></dl>

</div>
</div>
<a class="anchor" id="gae045e222efa8898716f8322c5667f624"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group__vector.html#gae045e222efa8898716f8322c5667f624">vector_delete</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structvector__t.html">vector_t</a> *&#160;</td>
          <td class="paramname"><em>self</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Deletes a vector. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a vector structure </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga0d33ab9aaff247d38876b1fe76c4e2ef"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="group__vector.html#ga0d33ab9aaff247d38876b1fe76c4e2ef">vector_empty</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structvector__t.html">vector_t</a> *&#160;</td>
          <td class="paramname"><em>self</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Checks whether the vector is empty. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a vector structure </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>1 if the vector is empty, 0 otherwise </dd></dl>

</div>
</div>
<a class="anchor" id="ga99460cea333533ca48e5cb23c37642f0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group__vector.html#ga99460cea333533ca48e5cb23c37642f0">vector_erase</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structvector__t.html">vector_t</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>index</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Erase an item. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a vector structure </td></tr>
    <tr><td class="paramname">index</td><td>the index of the item to be erased </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga089b70be0dbd06c497470359e725b4ef"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group__vector.html#ga089b70be0dbd06c497470359e725b4ef">vector_erase_range</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structvector__t.html">vector_t</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>first</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>last</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Erase a range of items. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a vector structure </td></tr>
    <tr><td class="paramname">first</td><td>the index of the first item to be erased </td></tr>
    <tr><td class="paramname">last</td><td>the index of the last item to be erased </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga89ea189955bd6c4873aca8288c96ad1b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const void* <a class="el" href="group__vector.html#ga89ea189955bd6c4873aca8288c96ad1b">vector_front</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structvector__t.html">vector_t</a> *&#160;</td>
          <td class="paramname"><em>self</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns a pointer to the first item. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a vector structure </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>pointer on the first item </dd></dl>

</div>
</div>
<a class="anchor" id="ga6ed3fefa82526009ff0763191dcd9a93"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const void* <a class="el" href="group__vector.html#ga6ed3fefa82526009ff0763191dcd9a93">vector_get</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structvector__t.html">vector_t</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>index</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns a pointer to the item located at specified index. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a vector structure </td></tr>
    <tr><td class="paramname">index</td><td>the index of the item to be returned </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>pointer on the specified item </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="demo-console_8c-example.html#a35">demo-console.c</a>, and <a class="el" href="demo-display-list_8c-example.html#a13">demo-display-list.c</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="gaa69087a65fe41ccc9a6763053a0db7da"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group__vector.html#gaa69087a65fe41ccc9a6763053a0db7da">vector_insert</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structvector__t.html">vector_t</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>item</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Insert a single item at specified index. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a vector structure </td></tr>
    <tr><td class="paramname">index</td><td>location before which to insert item </td></tr>
    <tr><td class="paramname">item</td><td>the item to be inserted </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaea8a2ae4d0d06d93f38b24697a5ac5ec"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group__vector.html#gaea8a2ae4d0d06d93f38b24697a5ac5ec">vector_insert_data</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structvector__t.html">vector_t</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>count</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Insert raw data at specified index. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a vector structure </td></tr>
    <tr><td class="paramname">index</td><td>location before which to insert item </td></tr>
    <tr><td class="paramname">data</td><td>a pointer to the items to be inserted </td></tr>
    <tr><td class="paramname">count</td><td>the number of items to be inserted </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga9ab13f896bb29debbbf8175e75751ea5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structvector__t.html">vector_t</a>* <a class="el" href="group__vector.html#ga9ab13f896bb29debbbf8175e75751ea5">vector_new</a> </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>item_size</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Creates a new empty vector. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">item_size</td><td>item size in bytes </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>a new empty vector </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="demo-console_8c-example.html#a5">demo-console.c</a>, and <a class="el" href="demo-display-list_8c-example.html#a22">demo-display-list.c</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="ga03f7948a7302fda208afe31bf7f324eb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group__vector.html#ga03f7948a7302fda208afe31bf7f324eb">vector_pop_back</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structvector__t.html">vector_t</a> *&#160;</td>
          <td class="paramname"><em>self</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Removes the last item of the vector. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a vector structure </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga0934c3049233d3688b7fa74e23536bbf"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group__vector.html#ga0934c3049233d3688b7fa74e23536bbf">vector_push_back</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structvector__t.html">vector_t</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>item</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Appends given item to the end of the vector. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a vector structure </td></tr>
    <tr><td class="paramname">item</td><td>the item to be inserted </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="demo-console_8c-example.html#a39">demo-console.c</a>, and <a class="el" href="demo-display-list_8c-example.html#a26">demo-display-list.c</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="gaabe89daaacdda4c42daf166e2f52f159"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group__vector.html#gaabe89daaacdda4c42daf166e2f52f159">vector_push_back_data</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structvector__t.html">vector_t</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>count</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Append raw data to the end of the vector. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a vector structure </td></tr>
    <tr><td class="paramname">data</td><td>a pointer to the items to be inserted </td></tr>
    <tr><td class="paramname">count</td><td>the number of items to be inserted </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga1a1e63e13a4da5587aa0b9369580eb85"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group__vector.html#ga1a1e63e13a4da5587aa0b9369580eb85">vector_reserve</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structvector__t.html">vector_t</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Reserve storage such that it can hold at last size items. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a vector structure </td></tr>
    <tr><td class="paramname">size</td><td>the new storage capacity </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gae88ff6d21d8f963ba97790086d18506a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group__vector.html#gae88ff6d21d8f963ba97790086d18506a">vector_resize</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structvector__t.html">vector_t</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Resizes the vector to contain size items. </p>
<p>If the current size is less than size, additional items are appended and initialized with value. If the current size is greater than size, the vector is reduced to its first size elements.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a vector structure </td></tr>
    <tr><td class="paramname">size</td><td>the new size </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga50c566682c6ec48ef8f7f4224c112d03"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group__vector.html#ga50c566682c6ec48ef8f7f4224c112d03">vector_set</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structvector__t.html">vector_t</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>item</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Replace an item. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a vector structure </td></tr>
    <tr><td class="paramname">index</td><td>the index of the item to be replaced </td></tr>
    <tr><td class="paramname">item</td><td>the new item </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="demo-console_8c-example.html#a40">demo-console.c</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="ga0b9c4f4cf48f0c52daa7852aeb7e531c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group__vector.html#ga0b9c4f4cf48f0c52daa7852aeb7e531c">vector_shrink</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structvector__t.html">vector_t</a> *&#160;</td>
          <td class="paramname"><em>self</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Decrease capacity to fit actual size. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a vector structure </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga0103842074bb797fc685b33c0629c05a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t <a class="el" href="group__vector.html#ga0103842074bb797fc685b33c0629c05a">vector_size</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structvector__t.html">vector_t</a> *&#160;</td>
          <td class="paramname"><em>self</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the number of items. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a vector structure </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>number of items </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="demo-display-list_8c-example.html#a12">demo-display-list.c</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="gaee95bbc2e143793c2ffdf3f107aac1bd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group__vector.html#gaee95bbc2e143793c2ffdf3f107aac1bd">vector_sort</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structvector__t.html">vector_t</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int(*)(const void *, const void *)&#160;</td>
          <td class="paramname"><em>cmp</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sort vector items according to cmp function. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a vector structure </td></tr>
    <tr><td class="paramname">cmp</td><td>a pointer a comparison function </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div>
</body>
</html>
